$(function(){
// 获取跳转详情页信息，渲染页面
// 判断是否携带哈希值(id值);location.hash 固定API获取
function getHash(){
    if(location.hash){
        getData().done( renderPage );
    }else{
        location.href = "index.html"
    }
}
getHash();
// 获取数据功能
function getData(){
    return $.ajax(`http://localhost:8888/goods/item/${location.hash.slice(1)}`);
}
// 渲染页面功能
function renderPage(data){
    let $info = data.info;
    $("#container").html(
        `<div class="top">
            <div class="left">
                <img src="${$info.img_big_logo}" alt="">
            </div>
            <div class="right">
                <h2>${$info.title}</h2>
                <h3>${$info.price}</h3>
            </div>
        </div>
    <div class="bottom">${$info.goods_introduce}</div>`
    )

}




















})